﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CodeFinder.Common.Interfaces;
using CodeFinder.Common.Entities;
using System.Data.Entity;

namespace CodeFinder.Bussiness.Concretes {
    public class CategoryService : ICategoryService {
        private IRepository<Caterory> m_categoryRepository;
        public CategoryService(DbContext context) {
            m_categoryRepository = new Repository<Caterory>(context);
        }
        public CategoryService()
            : this(new CodeFinderModelContainer()) {

        }
        public IList<Common.Entities.Caterory> GetAllCategories() {
            return m_categoryRepository.GetAll().ToList();
        }
    }
}
